home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog 125
/
Freelog_MarsAvril2015_No125.iso
/
Musique
/
Quod Libet
/
quodlibet-3.3.0-installer.exe
/
bin
/
quodlibet
/
qltk
/
ccb.pyc
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2014-12-31
|
2KB
|
44 lines
# Source Generated with Decompyle++
# File: in.pyc (Python 2.7)
from gi.repository import Gtk
from quodlibet import config
class ConfigCheckButton(Gtk.CheckButton):
"""A CheckButton that connects to QL's config module, and toggles
a boolean configuration value when it is toggled.
It is initialised to the current config value if `populate` is set True."""
def __init__(self, label, section, option, populate = False, tooltip = None, default = True):
super(ConfigCheckButton, self).__init__(label = label, use_underline = True)
if populate:
self.set_active(config.getboolean(section, option, default))
if tooltip:
self.set_tooltip_text(tooltip)
self.connect('toggled', ConfigCheckButton._ConfigCheckButton__toggled, section, option)
def __toggled(self, section, option):
config.set(section, option, str(bool(self.get_active())).lower())
class ConfigCheckMenuItem(Gtk.CheckMenuItem):
"""A CheckMenuItem that connects to QL's config module, and toggles
a boolean configuration value when it is toggled.
It is initialised to the current config value if `populate` is set True."""
def __init__(self, label, section, option, populate = False, default = False):
super(ConfigCheckMenuItem, self).__init__(label = label, use_underline = True)
if populate:
self.set_active(config.getboolean(section, option, default))
self.connect('toggled', ConfigCheckMenuItem._ConfigCheckMenuItem__toggled, section, option)
def __toggled(self, section, option):
config.set(section, option, str(bool(self.get_active())).lower())